var goods = [];

module.exports = {
  saveGoods: saveGoods,
  getGoodById: getGoodById
}
//保存所有商品数据
function saveGoods(data){
  goods = data;
}
/***
 * 获取商品详情
 * @param id 商品id
*/
function getGoodById(id){
  for(var x in goods){
    if(goods[x].goods_id == id){
      return goods[x]
    }
  }
  return null;
}

